import Vue from 'vue'
import APP from './App'
import VueRouter from 'vue-router'
import VueResource from 'vue-resource'
import Hello from './components/HelloWorld.vue'
import Hello2 from './components/Hello2.vue'

import './common/stylus/index.styl'

Vue.use(VueRouter)
// 调用use方法来使用vue-resource 插件，其实就是通过vue-resource来扩展了Vue实例，并给其增加了一个$http对象，通过该对象来调用vue-resource的方法
Vue.use(VueResource)

var router = new VueRouter({
  routes: [
    {
      path: '/first',
      component: Hello
    },
    {
      path: '/second',
      component: Hello2
    }
  ]
})
// router.go('/first')
/* eslint-disable no-new */
new Vue({
  el: '#app',
  router: router,
  template: '<APP/>',
  components: {
    APP
  }
})
